<?php
/**
{
    "visitorId": "INT //ID",
    "title": "VARCHAR //访问内容@search; ",
    "uid": "INT //用户@foreign::tbl_user; @noload; @search",
    "nick": "VARCHAR //昵称@noList; ",
    "avatar": "VARCHAR //头像@image; ",
    "courseId": "INT //课程@foreign::tbl_course; @search; ",
    "visitDate": "DATE //访问日期",
    "updated": "DATETIME //更新日期",
    "ip": "VARCHAR //ip@hide; @noList",
    "ipInfo": "VARCHAR //访问地址",
    "schoolId": "INT //机构@foreign::tbl_school; @search; ",
    "teacherId": "INT //老师id@foreign::tbl_teacher; @search; ",
    "duration": "INT //停留时间(s)",
    "times": "INT //访问次数",
    "leaveTime": "DATETIME //离开时间",
    "created": "DATETIME //创建时间@noload"
}
 */

class Visitor extends Base
{
    
	public $visitorId= '';//ID
	public $title= NULL;//访问内容@search;
	public $uid= '';//用户@foreign::tbl_user;@noload;@search
	public $nick= NULL;//昵称@noList;
	public $avatar= NULL;//头像@image;
	public $courseId= "0";//课程@foreign::tbl_course;@search;
	public $visitDate= NULL;//访问日期
	public $updated= 'CURRENT_TIMESTAMP';//更新日期
	public $ip= NULL;//ip@hide;@noList
	public $ipInfo= NULL;//访问地址
	public $schoolId= '';//机构@foreign::tbl_school;@search;
	public $teacherId= "0";//老师id@foreign::tbl_teacher;@search;
	public $duration= "1";//停留时间(s)
	public $times= "1";//访问次数
	public $leaveTime= 'CURRENT_TIMESTAMP';//离开时间
	public $created= 'CURRENT_TIMESTAMP';//创建时间@noload

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_visitor';
    }
    
    public  function key(){
        return 'visitorId';
    }


    
    public static  function hideField()
    {
        return array (  0 => 'ip',);
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return [];
    }
            
    public static  function deleteField()
    {
        return [];
    }
            
    public function className()
    {
        return 'Visitor';
    }
    
    public  function field()
    {
        return array (  'visitorId' =>   array (    0 => 'INT',    1 => 11,    2 => 'ID',  ),  'title' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '访问内容@search;',  ),  'uid' =>   array (    0 => 'INT',    1 => 11,    2 => '用户@foreign::tbl_user;@noload;@search',  ),  'nick' =>   array (    0 => 'VARCHAR',    1 => 100,    2 => '昵称@noList;',  ),  'avatar' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '头像@image;',  ),  'courseId' =>   array (    0 => 'INT',    1 => 11,    2 => '课程@foreign::tbl_course;@search;',  ),  'visitDate' =>   array (    0 => 'DATE',    1 => 0,    2 => '访问日期',  ),  'updated' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '更新日期',  ),  'ip' =>   array (    0 => 'VARCHAR',    1 => 15,    2 => 'ip@hide;@noList',  ),  'ipInfo' =>   array (    0 => 'VARCHAR',    1 => 100,    2 => '访问地址',  ),  'schoolId' =>   array (    0 => 'INT',    1 => 11,    2 => '机构@foreign::tbl_school;@search;',  ),  'teacherId' =>   array (    0 => 'INT',    1 => 11,    2 => '老师id@foreign::tbl_teacher;@search;',  ),  'duration' =>   array (    0 => 'INT',    1 => 11,    2 => '停留时间(s)',  ),  'times' =>   array (    0 => 'INT',    1 => 11,    2 => '访问次数',  ),  'leaveTime' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '离开时间',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建时间@noload',  ),);
    }


}